<!DOCTYPE html>
<html>
<head>
	<title>登陆</title>
	<link rel="stylesheet" type="text/css" href="/bower_components\bootstrap\dist\css\bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/style/article.css">
	<script type="text/javascript" src = '/bower_components\jquery\dist\jquery.min.js'></script>
	<script type="text/javascript" src='/bower_components\bootstrap\dist\js\bootstrap.min.js'></script>
</head>
<body>
	<div class="container">
		<div class="row" style="padding-top: 100px;">
			<div class="col-md-offset-3 col-md-6" id="load">
				<div class="page-header">
				<a href="/users/login" class="btn btn-primary btn-xs">登陆</a>
					<a href="/users/register" class="btn btn-success btn-xs  pull-right">注册</a>
				</div>
				<form action="dologin" method="POST">
					<div class="form-group">
						<label>用户名</label>
						<input type="text" class="form-control" name="username">
					</div>
					<div class="form-group">
						<label>密码</label>
						<input type="password" class="form-control" name="password">
					</div>
					<div class="form-group">
						<button id="submit" type="submit" class="btn btn-success">提交</button>
						<a href="/" class="btn btn-info pull-right">返回主页</a>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>
	<script type="text/javascript">
		$(function(){
			$("#submit").click(function(){
				$.post("dologin",{
					username:$("[name='username']").val(),
					password:$("[type='password']").val()
				},function(res,status){
					if (res=="ok") {
							window.location.href="/addmin"
						}else{
							alert("账户和密码错误")
						}
					})
				return false
				})
			})
	</script>